<?php
        namespace Admin\Model;
        use Think\Model;
        class AdminModel extends Model{
            //自动改密码为MD5
            protected $_auto = array(
                array('pass','md5',3,'function'),
                );
            //自动验证
            protected $_validate = array(
                array('username','require','账号不能为空',0,'regex',3),
                array('username','','用户已存在!',0,'unique',3),
                array('name','require','真实姓名不能为空'),
                array('pass','/^\w{6,32}$/','密码必须是6-12位的数字,字母,下划线',0,'regex',1),
                array('username','/^\w{4,32}$/','账户必须是4-32位的数字,字母,下划线',0,'regex',1),
                );
        }